<template>
  <view class="detail-wrap">
    <back :back-title="backTitle" class="back"></back>
		<view class="info-wrap">
			<view class="title">{{options.title}}</view>
			<view class="time">{{options.time}}</view>
			<view>
			  <u-parse :content="options.content" @preview="preview" @navigate="navigate" />
			</view>
		</view>
  </view>
</template>

<script>
import uParse from '../../../components/gaoyia-parse/parse'
const lunarCalendar = require('../../../utils/lunarCalendar')
export default {
  name: 'detail',
  components: {
    uParse
  },
  data() {
    return {
      backTitle: '信息详情',
			options: {
				time: '',
				content: '',
				title: ''
			}
    }
  },
	onLoad(options) {
		const {params} = options
		this.initData(params)
	},
  methods: {
    preview(src, e) {
      // do something
      console.log(src)
    },
    navigate(href, e) {
      // do something
      console.log(href)
    },
		initData(params) {
			const newParams = JSON.parse(params)
			newParams.content = unescape(newParams.content)
			this.options = newParams
			console.log(this.options)
		}
  }
}

</script>

<style lang='scss' scoped>
.detail-wrap{
  width: 100%;
  background-color: #fff;
  padding: 20upx;
  box-sizing: border-box;
	.back{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
	}
	.info-wrap {
		padding-top: 157upx;
		box-sizing: border-box;
		width: 100%;
	}
  .title{
    width: 100%;
    /* text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap; */
    font-size:38upx;
    line-height: 63upx;
  }
  .time{
    font-size:25upx;
    line-height: 25upx;
    margin-bottom: 43upx;
		color: #999;
  }
}
</style>